package mshop.com.schild_kotlin.adapters

import android.support.v4.app.Fragment
import android.support.v4.app.FragmentManager
import android.support.v4.app.FragmentPagerAdapter

/**
 * Created by mayi on 2018/5/27.
 * @Autor CaiWF
 * @Email 401885064@qq.com
 * @TODO
 */
class HotAdapter (var fm:FragmentManager,var titles:List<String>,var fragments:List<Fragment>):FragmentPagerAdapter(fm){
    override fun getItem(position: Int): Fragment {
        return fragments[position]
    }

    override fun getCount(): Int {
        return fragments.size
    }

    override fun getPageTitle(position: Int): CharSequence? {
        return titles[position%titles.size]
    }

}